package kr.hyunist.androidcomplete01saeildamil.ch09;

import kr.hyunist.androidcomplete01saeildamil.*;
import android.app.*;
import android.os.*;
import android.view.*;

public class MenuChangeTest extends Activity {
	boolean mb;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.changemenuex);
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		
		MenuInflater inflater = getMenuInflater();
		if(mb){
			inflater.inflate(R.menu.beginner, menu);
		} else {
			inflater.inflate(R.menu.professional, menu);
		}
		
		return true;
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.btnbeginner:
			mb = true;
			invalidateOptionsMenu();
			break;
			
		case R.id.btnprofessional:
			mb = false;
			invalidateOptionsMenu();
			break;
		}
	}
}
